package com.yishun.springboot.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.yishun.springboot.pojo.PinyiVehicleGetdata;
import com.yishun.springboot.pojo.WeiZhongYunVehicleGetData;

/**
 * 揚塵監測Device_code進行的DB查詢類
 * 
 * @author YS
 *
 */
@Component
public interface PinyiVehicleGetdataMapper {

	// 查出几天内的数据，第三个参数：null表现已经上传的也查出来，填任意值表示上传了的不查出
	List<PinyiVehicleGetdata> selectBetweenDayByDeviceNumber(@Param(value = "gateNo") String gateNo,
			@Param(value = "betweenDay") int betweenDay,
			@Param(value = "checkUploadGwsNumber") String checkUploadGwsNumber);

	List<PinyiVehicleGetdata> findByProjectNo(@Param(value = "ProjectNo") String ProjectNo,
			@Param(value = "betweenDay") int betweenDay,
			@Param(value = "checkUploadGwsNumber") String checkUploadGwsNumber);

	// 查出几月内的数据，第三个参数：null表现已经上传的也查出来，填任意值表示上传了的不查出
	List<PinyiVehicleGetdata> selectBetweenMonthByDeviceNumber(@Param(value = "gateNo") String gateNo,
			@Param(value = "betweenMonth") int betweenMonth,
			@Param(value = "checkUploadGwsNumber") String checkUploadGwsNumber);

	// 查找所有数据
	List<PinyiVehicleGetdata> findAll();

	// 查找最近一条的数据
	PinyiVehicleGetdata findOne(String truckNo);

	// 插入一条数据
	int innerOneRecord(PinyiVehicleGetdata pinyiVehicleGetdata);

	int insertAll(List<PinyiVehicleGetdata> pinyiVehicleGetdata);

}